#ifndef _MEMBER_BSERIALPORT_H_
#define _MEMBER_BSERIALPORT_H_

#include <BSharedMemory>

#ifdef linux
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#endif

#ifdef _WIN32
#include <windows.h>
#endif

namespace BWE
{
	class member_BSharedMemory
	{
	public:
		member_BSharedMemory(BSharedMemory* serialPort);
		~member_BSharedMemory();

		void freshComState();
		const char* checkError();

		BSharedMemory*			boss;
		BString					portName;
		IOMode					mode;
		int						size;
		BSharedMemory::Error	error;
#ifdef linux
		key_t		key;
		char*		buffer;
#endif
#ifdef _WIN32
		HANDLE		shrmem;
		LPVOID		buffer;
#endif
	};
}

#endif